#ifndef FDB_HELPERS_H
#define FDB_HELPERS_H 1

#include <fdb.h>

void helper_array_create_list(char **, size_t *, int, char **, size_t *);
int helper_array_get_item(char *, size_t, int, char **, size_t *);

void helper_manifest_create_list(char *, size_t, int, char **, char **, size_t *);
void helper_manifest_get_payload(char *, size_t, char **, size_t *);

typedef struct helper_sequence_t {
	char *name;
	int64_t value; /* Current value of the sequence. Do not set, except during create_sequence. */
	int64_t step;  /* Requested increase */

	/* These are private, do not touch them. */
	int64_t internal_value, internal_step;
	int internal_steps;
} helper_sequence_t;

int helper_sequence_create_table(database_t *, char *);
int helper_sequence_create_sequence(database_t *, transaction_t *, char *, int64_t);

#endif
